package bocchi.card;

import bocchi.BocchiCore;
import bocchi.base.BaseCustomCard;
import bocchi.base.BaseCustomPower;
import bocchi.general.Util;
import bocchi.power.ErosionPower;
import com.evacipated.cardcrawl.mod.stslib.actions.common.AllEnemyApplyPowerAction;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.powers.AbstractPower;

public class CurseEveryday extends BaseCustomCard {
    private static final String RAW_ID = CurseEveryday.class.getSimpleName();
    public static final String GAME_ID = BocchiCore.getGameID(RAW_ID);

    public CurseEveryday() {
        super(RAW_ID);
    }

    @Override
    public void use(AbstractPlayer player, AbstractMonster monster) {
        AbstractPower power = new BaseCustomPower(RAW_ID, AbstractPower.PowerType.BUFF, player, magicNumber) {
            @Override
            public void updateDescription() {
                description = String.format(descriptions[0], amount);
            }

            @Override
            public void atEndOfTurn(boolean isPlayer) {
                addToBot(new AllEnemyApplyPowerAction(player, amount, m -> new ErosionPower(m, amount)));
            }
        };

        Util.applyPower(player, player, power);
    }
}
